package com.example.mutildatasource.mapper.secondary;

import com.example.mutildatasource.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {

    @Select("SELECT t.id,t.user_name userName,t.password,t.sex,t.phone,t.address,date_format(t.create_time, '%Y-%m-%d %T') createTimeStr FROM user t")
    List<User> getAllByCondition(User user);

    @Insert("insert into user (user_name,PASSWORD,sex) VALUES (#{userName},#{password},#{sex})")
    void insertUser(User user);

}
